#!/usr/bin/env python
import re
import sys
def tokenizeLitStr(s):
    """take a js line, tokenize all literal strings inside it.
    return a list of the composing sections of the line,in which
    each element is (mark,value) tuple, the mark (bool) indicates
    wheither the sect is a litStr, and value holds the section str"""
    l = len(s)
    pos = 0
    res = []
    delim =None        
    secV = [] #str buffer
    
    while(pos < l):
        c = s[pos]
        
        if not delim:
            if(c =='/' and s[pos+1]=='/'):break #eliminate line comment
            if(c in """"'/"""):
                #the left str delimitor is found
                
                if secV:#push in the buffered code sect
                    res.append((False,''.join(secV)))
                delim = c
                secV =[c]
            else:
                secV.append(c)
        else:
            #get the rest of a literal string sect
            if c == "\\" and s[pos+1] == delim :# escape escaped quotemark
                secV+=[c,s[pos+1]]
                pos+=1                
            elif c == delim:                
                res.append((True,''.join(secV)+c))
                delim = None
                secV = []
            else:
                secV.append(c)
        
        pos+=1
    if secV and (not delim):# last code sect 
        res.append((False,''.join(secV))) 
##    else:
##        raise ValueError("Invalid javascript line: "+s)
    return res



def crunch():
    spn = re.compile('\s{2,}')
    tab = re.compile('\t+')    
    spl = re.compile('([%!&()*+,-/:;<=>?[\]\\{|}~])\s')
    spr = re.compile('\s([%!&()*+,-/:;<=>?[\]\\{|}~])')
    def deSpace(s):
        return spr.sub(r'\1',spl.sub(r'\1',tab.sub(' ',spn.sub(' ',s))))
    
    lBlockComm = '/*'
    rBlockComm = '*/'
    blockCommented = False
    
    for l in sys.stdin:
        l = tokenizeLitStr(l.strip())
        lineOut = []
        
        for isStr,v in l:            
            #walk thru sections            
            if not blockCommented:
                if isStr:
                    lineOut.append(v)
                else:#code                   
                    if lBlockComm in v:
                        lineOut.append(deSpace(v.split(lBlockComm)[0]))
                        blockCommented = True
                        break
                    else:
                        lineOut.append(deSpace(v))
            elif rBlockComm in v:#get rest of the block comment                
                    lineOut.append(deSpace(v.split(rBlockComm)[1]))
                    blockCommented = False
            else:#comment part ignored 
                pass
        if lineOut:sys.stdout.write(''.join(lineOut))

        
        
if __name__ == '__main__':
    crunch()